//////////////////////////////////////////////////////////////////////////
//	File	:	"IListener.h"
//
//	Author	:	David Brown (DB)
//
//	Purpose	:	Base class for objects registered with CSGD_EventSystem to
//				handle event broadcasts.
///////////////////////////////////////////////////////////////////////////
#pragma once

#include <vector>
#include <map>
#include <string>
using namespace std;

// Forward declaration does not require header includes.
class Event;

// ABSTRACT BASE CLASS
class IListener
{
	//The map, whose info is passed in from the level .xml at runtime,
	//		dictates which sender tags an object will pay attention to when handling a event.
	//
	//Additionally, the map's key is a string(The eventID to listen for), and 
	//		each eventID has a related vector of tags to handle.
	map<string, vector<string>> senderMap; 
	int numEvents;
public:
	IListener(void) {}
	virtual ~IListener(void);

	//	Blue print function - MUST be defined in the derived class.
	//	Mini-proc function for whenever this object receives an event
	virtual void HandleEvent(Event* pEvent) = 0;

	void addEventToMap(string eventID, vector<string> senderTags);
	void removeEventFromMap(string eventID);
	void removeAllEvents();
	vector<string>* getSenderTags(string eventID);
};
